#include <mysql.h>
#include <iostream>

int main() {
    MYSQL *conn;
    conn = mysql_init(NULL);

    if (!conn) {
        std::cerr << "MySQL initialization failed." << std::endl;
        return EXIT_FAILURE;
    }

    if (!mysql_real_connect(conn, "101.34.85.46", "gps", "laohutailu203", "gps", 0, NULL, 0)) {
        std::cerr << "Connection Error: " << mysql_error(conn) << std::endl;
        mysql_close(conn);
        return EXIT_FAILURE;
    }

    std::cout << "Successfully connected to the database." << std::endl;

    mysql_close(conn);
    return EXIT_SUCCESS;
}